let loginUrl = 'meeting/meetapp/Login' //授权登录
let modifyPasswordUrl = 'permission/Users/current/Actions/ModifyPasswordnocode'
let GetHomeBannerUrl = 'basic/AppBanner/GetBannerList'
let getAppModulesUrl = 'permission/authority/GetAppUserModule'
let hasPermissionUrl = 'permission/authority/HasPermission'
let getMeetroomsUrl = 'meeting/MeetWeChat/GetRoom'
let getTimeSoltDataUrl = 'meeting/MeetWeChat/GetTimesByRoomId'
let getCostRuleInfoByRoomIdUrl = 'meeting/CostRule/GetInfoByRoomId'
let getMeetroomSelectorUrl = 'meeting/meetroom/Selector'
let getRoomTimeByRoomIdUrl = 'meeting/meetroom/GetRoomTimeByRoomId'
let getDepartmentSelectorUrl = 'meeting/Department/Selector'
let createReserveUrl = 'meeting/meetapp/Create'
let updateReserveUrl = 'meeting/meetapp/Update'
let cancelReserveUrl = 'meeting/meetapp/Cancle'
let getReserveInfoUrl = 'meeting/meetapp/GetReserveInfo'
let getValueServiceListUrl = 'meeting/ValueService'
let getReserveUrl = 'meeting/meetapp/GetReserveList'
let rejectReserveUrl = 'meeting/meetapp/Reject'
let confirmReserveUrl = 'meeting/meetapp/Confirm'
let genFinOrderUrl = 'meeting/meetapp/GenFinOrder'
let getMyReserveUrl = 'meeting/meetapp/GetMyReserveList'
let getDutyListUrl = 'meeting/MeetApp/GetDutyList'
let cancelTodayDutyUrl = 'meeting/MeetApp/RemoveToDayDuty'
let getDutyDetailUrl = 'meeting/MeetApp/GetDutyInfo'
let updateDutyUrl = 'meeting/MeetApp/UpdateDuty'
let getMessageUrl = 'meeting/meetapp/GetMessageList'

// 采购
let applyBillListUrl = 'purch/appbill/GetList'
let applyInfoUrl = 'purch/appbill/GetInfo'
let categoryListUrl = 'purch/purchCategory/Selector'
let productListUrl = 'purch/appbill/GetProductList'
let createPurchApplyUrl = 'purch/appBill/Create'
let updatePurchApplyUrl = 'purch/appBill/Update'
let auidStatueUrl = 'purch/applytbill/AuidStatue'

let approveListUrl = 'purch/approvepro'
let auidStatueApproveUrl = 'purch/approvepro/AuidStatue'

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {

	let login = (params = {}) => vm.$u.post(loginUrl, params)
	let modifyPassword = (params = {}) => vm.$u.post(modifyPasswordUrl, params)
	let getAppModules = (params = {}) => vm.$u.post(getAppModulesUrl, params)
	let hasPermission = (params = {}) => vm.$u.get(hasPermissionUrl, params)
	let getHomeBanner = (params = {}) => vm.$u.get(GetHomeBannerUrl, params)
	let getMeetrooms = (params = {}) => vm.$u.get(getMeetroomsUrl, params)
	let getTimeSoltData = (params = {}) => vm.$u.get(getTimeSoltDataUrl, params)
	let getCostRuleInfoByRoomId = (params = {}) => vm.$u.get(getCostRuleInfoByRoomIdUrl, params)
	let getMeetroomSelector = (params = {}) => vm.$u.get(getMeetroomSelectorUrl, params)
	let getRoomTimeByRoomId = (params = {}) => vm.$u.get(getRoomTimeByRoomIdUrl, params)
	let getDepartmentSelector = (params = {}) => vm.$u.get(getDepartmentSelectorUrl, params)
	let createReserve = (params = {}) => vm.$u.post(createReserveUrl, params)
	let updateReserve = (params = {}) => vm.$u.post(updateReserveUrl, params)
	let cancelReserve = (params = {}) => vm.$u.post(cancelReserveUrl, params)
	let getReserveInfo = (params = {}) => vm.$u.get(getReserveInfoUrl, params)
	let getValueServiceList = (params = {}) => vm.$u.get(getValueServiceListUrl, params)
	let getReserve = (params = {}) => vm.$u.get(getReserveUrl, params)
	let rejectReserve = (params = {}) => vm.$u.post(rejectReserveUrl, params)
	let confirmReserve = (params = {}) => vm.$u.post(confirmReserveUrl, params)
	let genFinOrder = (params = {}) => vm.$u.post(genFinOrderUrl, params)
	let getMyReserve = (params = {}) => vm.$u.get(getMyReserveUrl, params)
	let getDutyList = (params = {}) => vm.$u.get(getDutyListUrl, params)
	let cancelTodayDuty =  (params = {}) => vm.$u.post(cancelTodayDutyUrl, params)
	let getDutyDetail = (params = {}) => vm.$u.get(getDutyDetailUrl, params)
	let updateDuty = (params = {}) => vm.$u.post(updateDutyUrl, params)
	let getMessage = (params = {}) => vm.$u.get(getMessageUrl, params)
	let getInfo = (params = {}) => vm.$u.get('oauth/CurrentUser', params)
	
	let applyBillList = (params = {}) => vm.$u.get(applyBillListUrl, params)
	let applyInfo = (params = {}) => vm.$u.get(applyInfoUrl, params)
	let categoryList = (params = {}) => vm.$u.get(categoryListUrl, params)
	let productList = (params = {}) => vm.$u.get(productListUrl, params)
	let createPurchApply = (params = {}) => vm.$u.post(createPurchApplyUrl, params)
	let updatePurchApply = (params = {}) => vm.$u.post(updatePurchApplyUrl, params)
	let auidStatue = (params = {}) => vm.$u.post(auidStatueUrl, params)
	let approveList = (params = {}) => vm.$u.get(approveListUrl, params)
	let auidStatueApprove = (params = {}) => vm.$u.post(auidStatueApproveUrl, params)
	

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		login,
		modifyPassword,
		getAppModules,
		hasPermission,
		getHomeBanner,
		getMeetrooms,
		getTimeSoltData,
		getCostRuleInfoByRoomId,
		getMeetroomSelector,
		getRoomTimeByRoomId,
		getDepartmentSelector,
		createReserve,
		updateReserve,
		cancelReserve,
		getReserveInfo,
		getValueServiceList,
		getReserve,
		rejectReserve,
		confirmReserve,
		genFinOrder,
		getMyReserve,
		getDutyList,
		cancelTodayDuty,
		getDutyDetail,
		updateDuty,
		getMessage,
		getInfo,
		applyBillList,
		applyInfo,
		categoryList,
		productList,
		createPurchApply,
		updatePurchApply,
		auidStatue,
		approveList,
		auidStatueApprove
	};
}


export default {
	install
}
const http = uni.$u.http